package com.ocom.common.request.exposeapi;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class ConsMealRequest extends GKDBaseRequest{

	@Min(1l)
	@NotNull(message = "pId 不能为空")
	@JsonProperty("pId")
	Long pId;

	@NotBlank(message = "machNo 不能为空")
	String machNo;

	@NotBlank(message = "consDate 日期不能为空")
	@Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$", message = "消费日期格式不正确，应为yyyy-MM-dd HH:mm:ss")
	String machTime;
	@Min(1l)
	@NotNull(message = "amount 不能为空")
	Integer amount;
	@NotBlank(message = "tradeNo 订单号不能为空")
	@Length(min = 32, max = 40, message = "tradeNo长度必须为32-40")
	String tradeNo;
	@NotBlank(message = "consDate 日期不能为空")
	@Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2}$", message = "日期格式不正确，应为yyyy-MM-dd")
	String consDate;
	@Min(1)
	@NotNull(message = "consMeal 不能为空")
	Integer consMeal;

}
